<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>开始使用layui</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
<blockquote class="layui-elem-quote">引用区域的文字</blockquote>
<!-- 你的HTML代码 -->

<script src="layui/layui.js"></script>
<script src="js/jquery.min.js"></script>
<script>
//一般直接写在一个js文件中
layui.use(['layer', 'form'], function(){
    var layer = layui.layer
    ,form = layui.form;

    $(function(){
        $.ajax({
            type: "GET",
            url: "demo",
            dataType: "json",
            success: function (result) {
                if (result.code == 0) {
                    layer.msg(result.data);
                }
            },
            error: function(){
            }
        });
    });
});
</script>
</body>
</html>